package org.yixiu.context;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TestContext {
    public static void main(String[] args) {
        // 容器启动完毕
        AnnotationConfigApplicationContext context = new
                AnnotationConfigApplicationContext(TestContext.class);
        String str = (String) context.getBean("user");
        System.out.println(str);
    }

    @Bean
    public String user() {
        return "user";
    }
}
